<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class GroupLiveCode extends BaseModel
{
    use HasFactory;

    /**
     * @group STATUS
     * @label 正常
     */
    const STATUS_ZC = 10;

    /**
     * @group STATUS
     * @label 暂停
     */
    const STATUS_ZT = 20;

    public $incrementing = false;

    public function getKeyType()
    {
        return 'string';
    }

    protected static function boot()
    {
        parent::boot();
        static::creating(function ($model) {
            if (!$model->getKey()) {
                $model->id = uniqid();
            }
        });
    }
}
